package view;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JPanel;

/*
 * This class is the small control panel at the bottom.
 * It has a next and previous button to allow the user to cycle through the
 * various photos.
 */
public class ControlPanelView extends JPanel{
    public JButton nextButton, previousButton;
    public MainView mainView;

    public ControlPanelView(MainView mainView){
        this.mainView = mainView;
        initComponents();
    }

    // <editor-fold defaultstate="collapsed" desc="Component initialization">
    public void initComponents(){
        nextButton = new JButton("Next");
        previousButton = new JButton("Previous");
        nextButton.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent e){
                mainView.getCards().next(mainView);
            }
        });
        previousButton.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent e){
                mainView.getCards().previous(mainView);
            }
        });

        add(previousButton);
        add(nextButton);
    }
    // </editor-fold>
}